Path="$SYSTEM_DEFAULTWORKINGDIRECTORY"
eval ContainerName="notification-hub"
eval HostName="Tiens.NotificationHub.WebHost"
IngressIp="notification-hub.tiens.com"
ENVIRONMENT="Production"
IMAGE_TAG=$BUILD_BUILDID

if [ -n "$1" ] && [ $1 = "test" ];then
    IngressIp="notification-hub-test.tiens.com"
	IMAGE_TAG="test-"$BUILD_BUILDID
	ENVIRONMENT="Development"
fi

echo $BUILD_BUILDID
echo $ContainerName

sed -i "s~<HostName>~$HostName~g" $Path/Dockerfile
sed -i "s~<IMAGE>~harbor.jtmm.com/tiens-info/$ContainerName~g" $Path/kubernetes.yaml
sed -i "s~<IMAGE_TAG>~$IMAGE_TAG~g" $Path/kubernetes.yaml
sed -i "s~<ENVIRONMENT>~$ENVIRONMENT~g" $Path/kubernetes.yaml
sed -i "s~<ContainerName>~$ContainerName~g" $Path/kubernetes.yaml
sed -i "s~<IngressIp>~$IngressIp~g" $Path/kubernetes.yaml
